Skip to content

[Feature] Forked Mainnet Simulation Tests#191

Merged
jribbink merged 91 commits intomainfrom
feature/forked-simulations
Apr 3, 2026
Merged

[Feature] Forked Mainnet Simulation Tests#191
jribbink merged 91 commits intomainfrom
feature/forked-simulations

Conversation

@jribbink
Copy link
Copy Markdown
Contributor

@jribbink jribbink commented Feb 27, 2026

Description

Feature branch that adds forked rebalance simulations for the real PYUSD0 strategy, mirroring those initially created via mocked bootstrapped tests.


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

RZhang05 and others added 30 commits January 8, 2026 16:21
Copy link
Copy Markdown
Contributor Author

@jribbink jribbink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM - Can you approve the PR again @zhangchiqing (It doesn't let me because I opened it)

@jribbink jribbink merged commit 5e77b29 into main Apr 3, 2026
15 checks passed
@jribbink jribbink deleted the feature/forked-simulations branch April 3, 2026 17:56
jribbink added a commit that referenced this pull request Apr 6, 2026
* Recreate scenario 1 using forked testnet.

* Remove unused function.

* Update for mainnet addresses.

* Use mUSDC strategy with real oracles on testnet.

* Update symbol prices.

* Switch to mainnet.

* Add option to transfer flow from whale account instead of minting.

* Use fixed mainnet height, new FUSDEV strategy.

* Add percent tolerance check to forked test.

* Clean up forked scenario 1.

* Remove unnecessary imports.

* Create forked scenario 2 with placeholder yield token function.

* [WIP] Modify EVM storage in forked scen2. Currently fails tolerance.

* Add EVM State Manipulation Helpers For Forked Simulations

* Clean up.

* Prepare for updated strategy.

* Fix bugs with decimal offsets & cleanup

* tidy comments

* Cleanup test helpers & fix precision

* Account for fees in pool prices to stay in tolerance.

* Update to newer CLI

* Create forked scenario 3a, 3b.

* address feedback

* Add test for EVM state helpers

* cleanup test assertion

* cleanup test assertion

* Fix percent tolerance

* Run CI on feature/* branches

* Update to new strategy and use new evm helpers.

* Clean up.

* Add EVM State Manipulation Helpers For Forked Simulations (#173)

* Fix band oracle price helper (#188)

* Fix merge.

* Normalize comments.

* Temporarily skip closing of yield vault.

* Apply suggestions from code review

Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>

* Switch flow.json back to tab spacing.

* Fix scenario 2.

* Delete unused files.

* Improve precision of forked tests

* Improve precision of forked tests (#190)

* Update scenario 2.

* Improve scenario 2 fee accounting and tolerance.

* Update forked scen 3a, 3b.

* Fix fork height.

* Add CI Caching for Forked Mainnet Simulation Tests (#192)

* Apply suggestions from code review

Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>

* Add Forked Mainnet Simulation Scenario 3C (#169)

* Improve final diagnostic precision.

* Forked Rebalance Simulation 3d (#172)

* Update Flow CLI Install to use Latest Version (#213)

* Add forked rebalance scenario 4. (#196)

* Add forked rebalance scenarios 4 and 5.

* Update forked scenarios to match main.

* Update scenarios 4,5.

* add boundary test cases

* Update fork test block height

* Remove unused Test.reset

* Restore commented out sections

* Apply suggestion from @zhangchiqing

Co-authored-by: Leo Zhang <zhangchiqing@gmail.com>

* Remove unnecessary yield vault rebalances

* Add note about Google Sheet

* Update cadence/tests/forked_rebalance_scenario1_test.cdc

Co-authored-by: Leo Zhang <zhangchiqing@gmail.com>

* add comments and more assertion on forked rebalance tests

* add more assertion and comments to forked_rebalance_scenario2_test.cdc

---------

Co-authored-by: Raymond Zhang <zhangraymond05@gmail.com>
Co-authored-by: Leo Zhang (zhangchiqing) <zhangchiqing@gmail.com>
jribbink added a commit that referenced this pull request Apr 7, 2026
* Recreate scenario 1 using forked testnet.

* Remove unused function.

* Update for mainnet addresses.

* Use mUSDC strategy with real oracles on testnet.

* Update symbol prices.

* Switch to mainnet.

* Add option to transfer flow from whale account instead of minting.

* Use fixed mainnet height, new FUSDEV strategy.

* Add percent tolerance check to forked test.

* Clean up forked scenario 1.

* Remove unnecessary imports.

* Create forked scenario 2 with placeholder yield token function.

* [WIP] Modify EVM storage in forked scen2. Currently fails tolerance.

* Add EVM State Manipulation Helpers For Forked Simulations

* Clean up.

* Prepare for updated strategy.

* Fix bugs with decimal offsets & cleanup

* tidy comments

* Cleanup test helpers & fix precision

* Account for fees in pool prices to stay in tolerance.

* Update to newer CLI

* Create forked scenario 3a, 3b.

* address feedback

* Add test for EVM state helpers

* cleanup test assertion

* cleanup test assertion

* Fix percent tolerance

* Run CI on feature/* branches

* Update to new strategy and use new evm helpers.

* Clean up.

* Add EVM State Manipulation Helpers For Forked Simulations (#173)

* Fix band oracle price helper (#188)

* Fix merge.

* Normalize comments.

* Temporarily skip closing of yield vault.

* Apply suggestions from code review

Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>

* Switch flow.json back to tab spacing.

* Fix scenario 2.

* Delete unused files.

* Improve precision of forked tests

* Improve precision of forked tests (#190)

* Update scenario 2.

* Improve scenario 2 fee accounting and tolerance.

* Update forked scen 3a, 3b.

* Fix fork height.

* Add CI Caching for Forked Mainnet Simulation Tests (#192)

* Apply suggestions from code review

Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>

* Add Forked Mainnet Simulation Scenario 3C (#169)

* Improve final diagnostic precision.

* Forked Rebalance Simulation 3d (#172)

* Update Flow CLI Install to use Latest Version (#213)

* Add forked rebalance scenario 4. (#196)

* Add forked rebalance scenarios 4 and 5.

* Update forked scenarios to match main.

* Update scenarios 4,5.

* add boundary test cases

* Update fork test block height

* Remove unused Test.reset

* Restore commented out sections

* Apply suggestion from @zhangchiqing

Co-authored-by: Leo Zhang <zhangchiqing@gmail.com>

* Remove unnecessary yield vault rebalances

* Add note about Google Sheet

* Update cadence/tests/forked_rebalance_scenario1_test.cdc

Co-authored-by: Leo Zhang <zhangchiqing@gmail.com>

* add comments and more assertion on forked rebalance tests

* add more assertion and comments to forked_rebalance_scenario2_test.cdc

---------

Co-authored-by: Raymond Zhang <zhangraymond05@gmail.com>
Co-authored-by: Leo Zhang (zhangchiqing) <zhangchiqing@gmail.com>
jribbink added a commit that referenced this pull request Apr 7, 2026
Co-authored-by: Leo Zhang (zhangchiqing) <zhangchiqing@gmail.com>
Co-authored-by: Raymond Zhang <zhangraymond05@gmail.com>
jribbink added a commit that referenced this pull request Apr 7, 2026
Co-authored-by: Leo Zhang (zhangchiqing) <zhangchiqing@gmail.com>
Co-authored-by: Raymond Zhang <zhangraymond05@gmail.com>
jribbink added a commit that referenced this pull request Apr 9, 2026
Co-authored-by: Leo Zhang (zhangchiqing) <zhangchiqing@gmail.com>
Co-authored-by: Raymond Zhang <zhangraymond05@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants